package com.xmg.boot.demo.bootlesson1.user.entity.dm;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 员工表
 * </p>
 *
 * @author 微信搜一搜：贺贺学编程
 * @since 2023-11-29
 */
@Data
public class Employee implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "EMPLOYEE_ID", type = IdType.AUTO)
    private Integer employeeId;

    /**
     * 员工姓名
     */
    private String employeeName;

    /**
     * 雇佣时间
     */
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Date hireDate;

    /**
     * 薪水
     */
    private BigDecimal salary;

    /**
     * 部门Id
     */
    private Integer departmentId;


    /**
     * 外键 - 关联部门名称
     */
    @TableField(exist = false)
    private String departmentName;

    /**
     * 外键 - 管理部门实体
     * 假设需要一个部门下面的所有用户
     */
    @TableField(exist = false)
    private Department department;
}
